//
//  LogManager.h
//  AppLog
//
//  Created by chenjs on 2025/4/7.
//

#import <Foundation/Foundation.h>
#import "RecordEnums.h"
#import <UIKit/UIKit.h>
#import "RecordFileModel.h"

NS_ASSUME_NONNULL_BEGIN

@interface RecordManager : NSObject
@property (nonatomic, copy) NSString *recordKey;
@property (nonatomic, copy) NSString *systemModuleName;
@property (nonatomic, copy) NSString *safeModuleName;
@property (nonatomic, copy) NSString *authModuleName;

//单个文件大小, 默认 10M
@property (nonatomic, assign) NSInteger oneFileSize;

//单个日志类型的总大小， 默认100M
@property (nonatomic, assign) NSInteger totalFileSize;

//过期几天的日志会被自动删除，默认7天
@property (nonatomic, assign) NSInteger expireDay;

//启动日志
- (void)recordStart;
+ (instancetype)sharedInstance;

//记录
- (void)recordWithType:(CatchLogType)type needEncrypt:(BOOL)needEncrypt args:(NSString *)args;

/// 获取日志文件列表
- (NSArray<RecordFileModel *> *)getLogModelsWithType:(CatchLogType)type;

/// 分享某个日志文件
/// - Parameter model: 日志文件model
- (void)airdropWithModel:(RecordFileModel *)model currentVC:(UIViewController *)vc ipadFromView:(nullable UIView *)fromView;

/// 删除某个日志文件
/// - Parameter model: 日志文件model
- (BOOL)removeLogModel:(RecordFileModel *)model;

/// （注意！！！！）删除所有的日志文件
- (void)cleanAll;

/// 清理过期或者总大小文件
- (void)cleanLogsWithType:(CatchLogType)type;
@end

NS_ASSUME_NONNULL_END
